<uieip type="page" value="base"></uieip>
<!DOCTYPE html>
<html lang="zh">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>基础折线图</title>
  <uieip type="file" value="inc" src="/yqwin/easyui/include.txt" cache="true" minute="1440"></uieip>
  <uieip type="file" value="css" src="/yqwin/css/yqwin.min" cache="false"></uieip>
  <uieip type="file" value="js" src="/yqwin/data/yqwin.min" cache="false"></uieip>
  <script type="text/javascript" src="/scripts/echarts/echarts.min.js"></script>
</head>

<body>
  <a href="javascript:window.history.back();">返回</a>
  <table style="margin-top: 10px;">
    <tr>
      <td>
        <div id="div_container" style="width:800px;height:600px;padding:0px;border:1px solid rgb(239, 239, 239);">
        </div>
      </td>
      <td>
        <div id="div_editor" style="width:450px;height:600px;"></div>
      </td>
    </tr>
  </table>
  <script type="text/javascript">
    var option = {
      title: {
        text: '折叠图堆叠'
      },
      tooltip: {
        trigger: 'axis'
      },
      legend: {
        data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
      toolbox: {
        feature: {
          saveAsImage: {}
        }
      },
      xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          name: 'Email',
          type: 'line',
          stack: 'Total',
          data: [120, 132, 101, 134, 90, 230, 210]
        },
        {
          name: 'Union Ads',
          type: 'line',
          stack: 'Total',
          data: [220, 182, 191, 234, 290, 330, 310]
        },
        {
          name: 'Video Ads',
          type: 'line',
          stack: 'Total',
          data: [150, 232, 201, 154, 190, 330, 410]
        },
        {
          name: 'Direct',
          type: 'line',
          stack: 'Total',
          data: [320, 332, 301, 334, 390, 330, 320]
        },
        {
          name: 'Search Engine',
          type: 'line',
          stack: 'Total',
          data: [820, 932, 901, 934, 1290, 1330, 1320]
        }
      ]
    };

    var myChart;
    var app = {};
    $(function () {
      var dom = document.getElementById('div_container');
      myChart = echarts.init(dom, null, {
        renderer: 'canvas',
        useDirtyRect: false
      });

      myChart.setOption(option);

      init_editor();
    });

    function init_editor() {
      $("#div_editor").yqCodeEdit({
        types: ["json"],
        type: "json",
        value: JSON.stringify(option, null, 2)
      });
    }
  </script>
</body>

</html>